package cn.gdcp.demo7_2;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private Button btnEat;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnEat = findViewById(R.id.btn_eat);
        btnEat.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();

                //第一种
                /*intent.setAction("I_WANT_EAT");
                intent.addCategory("NIU_ROU_FAN");
                startActivity(intent);*/

                //第二种
               intent.setClassName("cn.gdcp.demo7",
                       "cn.gdcp.activity.SecondRestaurantActivity");
               startActivity(intent);


            }
        });



    }
}
